/**
 * @author Tony
 * @date 2018-01-10
 * @project rest_demo
 */
package com.xsh.gls.utils.restDemo;

import com.xsh.gls.utils.restDemo.client.AbsRestClient;
import com.xsh.gls.utils.restDemo.client.JsonReqClient;

public class Rest {

	static AbsRestClient InstantiationRestAPI(){
		return new JsonReqClient();
	}
	
	public static String testSendSms(String sid, String token, String appid, String templateid, String param, String mobile, String uid){
		String result = null;
		try {
			 result=InstantiationRestAPI().sendSms(sid, token, appid, templateid, param, mobile, uid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	public static String SimpleParamSend(String mobile, String uid) {
		String sid = "4acabfbb6fafe39af3aefcb0f38f9bc5";
		String token = "d878716f3a39958ef676dee839361ee8";
		String appid = "72ab639b8d4d4fd89a93b6e77b7eece0";
		String templateid = "422052";
		String i=String.valueOf((int)(Math.random()*8998+1001));
		String param = i;
		if (testSendSms(sid, token, appid, templateid, param, mobile, uid) != null){
			return  param;
		}else {
			return  null;
		}


	}
}